package club.haomoon.boss.controller.adminapi;

import club.haomoon.boss.service.IIndexService;
import club.haomoon.core.aop.FreeLogin;
import club.haomoon.core.common.AjaxResult;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import jakarta.annotation.Resource;
import java.util.Map;

@Slf4j
@RestController
@RequestMapping("adminapi/config")
@Tag(name =  "主页数据管理")
public class ConfigController {

    @Resource
    IIndexService iIndexService;
    @FreeLogin
    @GetMapping("/getConfig")
    @Operation(summary="公共配置")
    public AjaxResult<Map<String, Object>> getConfig() {
        Map<String, Object> map = iIndexService.config();
        return AjaxResult.success(map);
    }

}
